<template>
    <div v-show="contactShow">
        <div class="shadow">
            <div class="white">
                <div class="white-tit">
                    <div>客服电话</div>
                    <img @click="contactShow = false" src="../assets/img/icon_close.png">
                </div>
                <div class="tel-text">{{phone}}</div>
                <img class="contact-img" src="../assets/second_icon/contact_img.png" alt="">
            </div>
        </div>
    </div>
</template>

<script>
import {getUser} from '@/api/user'
export default {
    data() {
        return {
            contactShow: false,
            phone:""
        };
    },
    mounted(){
        this.getUsers()
    },
    methods: {
        // 获取联系方式
        getUsers(){
            getUser().then(res=>{
                console.log(res)
                this.phone = res.data.site_phone;
            })
        },
        open() {
            this.contactShow = true;
        },
    },
};
</script>

<style scoped  lang="scss" scoped>
.shadow {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
    .white {
        width: 391px;
        height: 250px;
        background: #ffffff;
        border-radius: 10px;
        padding-top: 20px;
        position: absolute;
        top: 25%;
        bottom: -50%;
        left: 40%;
        .white-tit {
            display: flex;
            position: relative;
            width: 100%;
            justify-content: center;
            div {
                &:first-child {
                    font-size: 18px;
                    text-align: center;
                    color: #1c2833;
                }
            }
            img {
                width: 16px;
                height: 16px;
                position: absolute;
                right: 19px;
                top: 2px;
                cursor: pointer;
            }
        }
        .tel-text {
            text-align: center;
            margin-top: 10px;
            font-size: 24px;
            color: #1c2833;
        }
        .contact-img {
            width: 100px;
            height: 94px;
            display: block;
            margin: 41px auto 0;
        }
    }
}
</style>